#include "comm.h"

int main()
{
    int fd = open(FILE_NAME,O_WRONLY);
    if(fd < 0)
    {
        perror("open");
        return 1;
    }
    char buff[128];
    while(1)
    {
        buff[0] = '\0';
        printf("please enter:");
        fflush(stdout);
        ssize_t s = read(0,buff,sizeof(buff) - 1);
        if(s > 0)
        {
            buff[s - 1] = '\0';
            write(fd,buff,strlen(buff));
        }
    }
    close(fd);

    return 0;
}